package org.spring.boot.fusion.controller;

import org.jasypt.encryption.StringEncryptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestController {
	
	@Autowired
    private StringEncryptor stringEncryptor;
	@Autowired
	private Environment environment;
	
	@Value("${spring.application.name}")
	private String name;
	
	@GetMapping("test")
	public String test() {
		String property = environment.getProperty("spring.application.name");
		String encrypt = stringEncryptor.encrypt("123456789000000");
		System.out.println(encrypt);
		return property+"-------------"+name;
	}
}
